// pages/nopay/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    list: []
  },
  //   查询列表
  getTollCollectorPaymentOrderList() {
    let params = {
      payStatus: 0,
      tollCollectorId: wx.getStorageSync('info').tollCollectorId
    }
    this.setData({
      list: [{
        tollCollectorPaymentOrderId: 1,
        licensePlateNumber: '苏e12345',
        amount: 88.00,
        parkingSpaceName: '测试街001车位',
        createTime: '2023.11.09 09:00:00'
      }]
    })
  },
  // 取消订单
  cancel(e) {
    console.log(e)
    let tollcollectorpaymentorderid = e.currentTarget.dataset.tollcollectorpaymentorderid
    wx.showModal({
      title: '温馨提示',
      content: '确认取消订单吗？',
      complete: (res) => {
        if (res.cancel) {

        }

        if (res.confirm) {
          wx.showToast({
            title: '取消成功'
          })
        }
      }
    })
  },
  // 查看订单
  look(e) {
    console.log(e)
    let tollcollectorpaymentorderid = e.currentTarget.dataset.tollcollectorpaymentorderid
    getApp().globalData.tollcollectorpaymentorderid = tollcollectorpaymentorderid
    wx.navigateTo({
      url: '../detail/index',
    })
  },
  // 返回首页
  onClickLeft() {
    wx.switchTab({
      url: '/pages/work/index',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getTollCollectorPaymentOrderList()
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    if (typeof this.getTabBar === 'function' &&
      this.getTabBar()) {
      const pageType = getApp().globalData.pageType
      this.getTabBar().setData({
        selected: 1,
        list: [{
            "pagePath": "/pages/pay/index",
            "text": "补交停车费",
            "iconPath": "/images/tabbar/pay.png",
            "selectedIconPath": "/images/tabbar/paya.png"
          },
          {
            "pagePath": "/pages/pay/nopay/index",
            "text": "未支付订单",
            "iconPath": "/images/tabbar/nopay.png",
            "selectedIconPath": "/images/tabbar/nopaya.png"
          },
          {
            "pagePath": "/pages/pay/ispay/index",
            "text": "已支付订单",
            "iconPath": "/images/tabbar/ispay.png",
            "selectedIconPath": "/images/tabbar/ispaya.png"
          }
        ]
      })
    }
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})